package com.example.base.crash

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.example.base.R

/**
 * Created by wanjian on 2018/5/21.
 */
class DebugSafeModeTipActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_safe_mode_warning)
        findViewById<View>(R.id.log).setOnClickListener {
            var fragment = supportFragmentManager.findFragmentByTag(
                CrashLogFragment::class.java.name
            )
            if (fragment == null) {
                fragment = CrashLogFragment()
            }
            supportFragmentManager
                .beginTransaction()
                .replace(R.id.container, fragment, CrashLogFragment::class.java.name)
                .commit()
        }
    }
}